CREATE TABLE [dbo].[tblContactByRecruiters] (
	[JobID] [int] NOT NULL ,
	[ResumeID] [int] NOT NULL ,
	[RecruiterID] [int] NOT NULL ,
	[JobTitle] [nvarchar] (50)  NULL ,
	[ContactName] [nvarchar] (50)  NULL ,
	[ContactSubject] [nvarchar] (50)  NULL ,
	[ContactBody] [ntext]  NULL ,
	[ContactDate] [smalldatetime] NULL ,
	[ContactStatus] [tinyint] NULL ,
	[PostedDate] [smalldatetime] NULL ,
	[CloseDate] [smalldatetime] NULL ,
	[UpdatedDate] [smalldatetime] NULL 
	PRIMARY KEY (RecruiterID, ResumeID, JobID)
)  
GO
CREATE TABLE [dbo].[tblRCAccounts] (
	[RecruiterID] [int] IDENTITY (1, 1) 
	NOT NULL PRIMARY KEY,
	[Email] [varchar] (50)  NOT NULL ,
	[Password] [varchar] (20)  NULL ,
	[CompanyName] [nvarchar] (50)  NULL ,
	[EnglishName] [varchar] (50)  NULL ,
	[AccountType] [bit] NULL ,
	[OpenDate] [smalldatetime] NULL ,
	[ContactName] [nvarchar] (50)  NULL ,
	[Address] [nvarchar] (50)  NULL ,
	[City] [nvarchar] (30)  NULL ,
	[ProvinceID] [tinyint] NULL ,
	[Country] [varchar] (30)  NULL ,
	[Phone] [varchar] (20)  NULL ,
	[Fax] [varchar] (20)  NULL ,
	[Logo] [bit] NULL ,
	[JobPostingBalance] [smallint] NOT NULL ,
	[ResumeViewingBalance] [smallint] NOT NULL ,
	[Activate] [bit] NOT NULL ,
	[Promotion] [bit] NOT NULL ,
	[ResumeAlert] [bit] NULL ,
	[Newsletter] [bit] NOT NULL ,
	[Agency] [bit] NOT NULL ,
	[AvailableForPosting] [smallint] NOT NULL ,
	[AvailableForViewing] [smallint] NOT NULL ,
	[RegisterDate] [smalldatetime] NOT NULL ,
	[LastLogin] [smalldatetime] NULL ,
	[HitViewed] [int] NULL ,
	[DefaultLanguage] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblRCFolders] (
	[FolderID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY,
	[RecruiterID] [int] NOT NULL ,
	[FolderName] [varchar] (10)  NOT NULL ,
	[FolderDescription] [nvarchar] (50)  NULL ,
	[FolderManager] [nvarchar] (50)  NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblRCJobHistory] (
	[JobID] [int] NOT NULL ,
	[RecruiterID] [int] NOT NULL ,
	[JobTitle] [nvarchar] (100)  NOT NULL ,
	[JobCategoryID] [tinyint] NOT NULL ,
	[CertificateID] [tinyint] NOT NULL ,
	[ContactEmail] [varchar] (50)  NOT NULL ,
	[ContactPerson] [nvarchar] (50)  NOT NULL ,
	[ContactTel] [varchar] (10)  NOT NULL ,
	[ClosedDate] [smalldatetime] NOT NULL ,
	[JobNo] [varchar] (10)  NULL ,
	[RequiredNumber] [tinyint] NOT NULL ,
	[PostedDate] [smalldatetime] NOT NULL ,
	[UpdatedDate] [smalldatetime] NOT NULL ,
	[Activate] [bit] NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblRCJobPostings] (
	[JobID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY,
	[RecruiterID] [int] NOT NULL ,
	[JobTitle] [nvarchar] (100)  NOT NULL ,
	[JobIndustryID] [tinyint] NOT NULL ,
	[JobCategoryID] [tinyint] NOT NULL ,
	[CertificateID] [tinyint] NOT NULL ,
	[RangeOfAge] [nvarchar] (50)  NULL ,
	[RecruitmentType] [nvarchar] (50)  NULL ,
	[AdvName] [nvarchar] (1000)  NULL ,
	[ContactEmail] [varchar] (50)  NOT NULL ,
	[ContactPerson] [nvarchar] (50)  NOT NULL ,
	[ContactTel] [varchar] (10)  NOT NULL ,
	[ProvinceID] [tinyint] NULL ,
	[WorkLocation] [varchar] (20)  NULL ,
	[Viewable] [bit] NOT NULL ,
	[ClosedDate] [smalldatetime] NOT NULL ,
	[JobSummary] [ntext]  NOT NULL ,
	[JobSkills] [ntext]  NULL ,
	[JobNo] [varchar] (10)  NULL ,
	[RequiredNumber] [tinyint] NOT NULL ,
	[WorkingTypeID] [tinyint] NOT NULL ,
	[ExperienceLevelID] [tinyint] NOT NULL ,
	[YearExperience] [nvarchar] (50)  NULL ,
	[SalaryFrom] [int] NULL ,
	[SalaryTo] [int] NULL ,
	[Currency] [char] (3)  NULL ,
	[ShowSalary] [bit] NOT NULL ,
	[SalaryNegotive] [bit] NOT NULL ,
	[CompanyLogo] [bit] NOT NULL ,
	[EnableApplyOnline] [bit] NOT NULL ,
	[OnlyApplyURL] [varchar] (100)  NULL ,
	[ViewedNo] [tinyint] NULL ,
	[FolderID] [int] NULL ,
	[TemplateID] [tinyint] NOT NULL ,
	[PostedDate] [smalldatetime] NOT NULL ,
	[UpdatedDate] [smalldatetime] NOT NULL ,
	[Activate] [bit] NOT NULL 
)  
GO

CREATE TABLE [dbo].[tblRCSavedResumes] (
	[RecruiterID] [int] NOT NULL ,
	[ResumeID] [int] NOT NULL ,
	[JobPosition] [nvarchar] (50)  NOT NULL ,
	[SaveDate] [smalldatetime] NOT NULL 
	PRIMARY KEY (RecruiterID, ResumeID)
)  
GO

CREATE TABLE [dbo].[tblRCSavedSearchs] (
	[SearchID] [int] IDENTITY (1, 1) 
	NOT NULL PRIMARY KEY,
	[RecruiterID] [int] NULL ,
	[Keyword] [nvarchar] (50)  NULL ,
	[JobCategoryID] [tinyint] NULL ,
	[JobIndustryID] [tinyint] NULL ,
	[CertificateID] [tinyint] NULL ,
	[ProvinceID] [tinyint] NULL ,
	[WorkingLevelID] [tinyint] NULL ,
	[WorkingTypeID] [tinyint] NULL ,
	[Gender] [tinyint] NULL ,
	[Availability] [tinyint] NULL ,
	[MinAge] [tinyint] NULL ,
	[MaxAge] [tinyint] NULL ,
	[SaveDate] [smalldatetime] NULL 
	
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblSalesPackage] (
	[SalesPackageID] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY,
	[RecruiterID] [int] NOT NULL ,
	[ContactName] [nvarchar] (100)  NOT NULL ,
	[OrderDate] [smalldatetime] NOT NULL ,
	[PaymentCurrency] [char] (3)  NULL ,
	[PaymentBy] [nvarchar] (50)  NULL ,
	[PaidStatus] [bit] NULL ,
	[PaidDate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblSalesPackageDetails] (
	[SalesPackageID] [int] NOT NULL ,
	[PackageName] [nvarchar] (100)  NULL ,
	[PackageQuantity] [tinyint] NULL ,
	[PackagePrice] [int] NULL ,
	[PackageType] [bit] NULL 
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[tblPackages] (
	[PackageID] [int] IDENTITY (1, 1) 
	NOT NULL PRIMARY KEY,
	[StartDate] [smalldatetime] NULL ,
	[EndDate] [smalldatetime] NULL ,
	[Program] [nvarchar] (50)   NULL ,
	[Name] [nvarchar] (100)   NULL ,
	[MinQuantity] [tinyint] NULL ,
	[MaxQuantity] [tinyint] NULL ,
	[Price] [int] NULL ,
	[Discount] [tinyint] NULL ,
	[Currency] [char] (3)   NULL ,
	[Type] [bit] NULL ,
	[Activate] [bit] NULL ,
	[EntryDate] [smalldatetime] NULL 
) 
